package com.bp.village.assets.service.impl;

import java.util.List;
                                                                                                                                                                                import com.bp.common.utils.DateUtils;
            import javax.annotation.Resource;

import com.bp.framework.util.SecurityUtils;
import org.springframework.stereotype.Service;
import com.bp.village.assets.mapper.BizVillageBuildingProofMapper;
import com.bp.village.assets.domain.BizVillageBuildingProof;
import com.bp.village.assets.service.IBizVillageBuildingProofService;

/**
 * 村级房产权证情况Service业务层处理
 *
 * @author shaominjie
 * @date 2021-02-01
 */
@Service
public class BizVillageBuildingProofServiceImpl implements IBizVillageBuildingProofService {
    @Resource
    private BizVillageBuildingProofMapper bizVillageBuildingProofMapper;

    /**
     * 查询村级房产权证情况
     *
     * @param proofId 村级房产权证情况ID
     * @return 村级房产权证情况
     */
    @Override
    public BizVillageBuildingProof selectById(Long proofId) {
        return bizVillageBuildingProofMapper.selectById(proofId);
    }

    /**
     * 查询村级房产权证情况列表
     *
     * @param bizVillageBuildingProof 村级房产权证情况
     * @return 村级房产权证情况
     */
    @Override
    public List<BizVillageBuildingProof> selectList(BizVillageBuildingProof bizVillageBuildingProof) {
        return bizVillageBuildingProofMapper.selectList(bizVillageBuildingProof);
    }

    /**
     * 新增村级房产权证情况
     *
     * @param bizVillageBuildingProof 村级房产权证情况
     * @return 结果
     */
    @Override
    public int insert(BizVillageBuildingProof bizVillageBuildingProof) {
        bizVillageBuildingProof.setCreateTime(DateUtils.getNowDate());
        bizVillageBuildingProof.setCreateBy(SecurityUtils.getUsername());
        return bizVillageBuildingProofMapper.insert(bizVillageBuildingProof);
    }

    /**
     * 修改村级房产权证情况
     *
     * @param bizVillageBuildingProof 村级房产权证情况
     * @return 结果
     */
    @Override
    public int update(BizVillageBuildingProof bizVillageBuildingProof) {
        bizVillageBuildingProof.setUpdateTime(DateUtils.getNowDate());
        bizVillageBuildingProof.setUpdateBy(SecurityUtils.getUsername());
        return bizVillageBuildingProofMapper.update(bizVillageBuildingProof);
    }

    /**
     * 批量删除村级房产权证情况
     *
     * @param proofIds 需要删除的村级房产权证情况ID
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] proofIds) {
        return bizVillageBuildingProofMapper.deleteByIds(proofIds);
    }

    /**
     * 删除村级房产权证情况信息
     *
     * @param proofId 村级房产权证情况ID
     * @return 结果
     */
    @Override
    public int deleteById(Long proofId) {
        return bizVillageBuildingProofMapper.deleteById(proofId);
    }

    /**
     * 获取当前房产的证书
     *
     * @param buildingId
     * @return
     */
    @Override
    public List<BizVillageBuildingProof> selectByBuildingId(Long buildingId) {
        return bizVillageBuildingProofMapper.selectByBuildingId(buildingId);
    }
}
